﻿using HslCommunication.CNC.Fanuc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AutoMachine
{
    /// <summary>
    /// 全局变量类
    /// </summary>
  public  class GlobalVar
    {
        /// <summary>
        /// 蜂鸣器屏蔽
        /// </summary>
        public static bool BuzzerScreen = false;//全局变量 蜂鸣器屏蔽信号1

        public static bool Buzzer = false;//全局变量 蜂鸣器全局变量
                                          //定义一个委托
        public static bool Buzzer1 = false;//全局变量 蜂鸣器全局变量
        public static bool ClearRun = false;
        /// <summary>
        /// 单步模式
        /// </summary>
        public static bool OneStep = false;//全局变量 单步模式

        /// <summary>
        /// 视觉屏蔽
        /// </summary>
        public static bool VisScreen = false;//视觉屏蔽 

        /// <summary>
        /// 相机重复拍照
        /// </summary>
        public static bool VisRepate = false;//相机重复拍照

        public static List<string> LenList = new List<string>();
        /// <summary>
        /// 安全门
        /// </summary>
        public static bool Door = false;//安全门

        public static bool[] GetDI = new bool[16];
        /// <summary>
        /// 单机模式
        /// </summary>
        public static bool StandLine = false;//单机模式
       
        public static List<string> Datas = new List<string>();
        public static List<string> DataCCD = new List<string>();
       
        public static List<string> ListTotal = new List<string>();//总数数据
        public static List<string> ListOK = new List<string>();//OK数据
        public static List<string> ListNG = new List<string>();//NG数据
        public static bool CuiHai = true;
        public static bool CamerL_Over = true;
        public static bool CamerR_Over = true;
        public static bool isSaveImg = false;
       
     

        /// <summary>
        /// IO-1
        /// </summary>
        public static TCPClientScan CCDTCP = new TCPClientScan("192.168.1.100","4196");

        /// <summary>
        /// IO-2
        /// </summary>
        public static TCPClientScan CCDTCP2 = new TCPClientScan("192.168.1.200", "4196");

        /// <summary>
        /// 电测
        /// </summary>
        public static TCPClientScan LCRTCP = new TCPClientScan("169.254.32.204", "5024");
    }
    public class Offset
    {
        public double X = 0;
        public double Y = 0;
        public double U = 0;

    }
    public class ModeBusSend
    {
        public byte[] GetDI = {0x01,0x01,0x00,0x00, 0x00, 0x08,0x3d,0xcc };
        public byte[] SetD01On = { 0x01, 0x05, 0x00, 0x10, 0xff, 0x00, 0x8d, 0xff };
        public byte[] SetD01Off = { 0x01, 0x05, 0x00, 0x10, 0x00, 0x00, 0xcc, 0x0f };
        public byte[] SetD02On = { 0x01, 0x05, 0x00, 0x11, 0xff, 0x00, 0xdc, 0x3f };
        public byte[] SetD02Off = { 0x01, 0x05, 0x00, 0x11, 0x00, 0x00, 0x9d, 0xcf };
        public byte[] SetD03On = { 0x01, 0x05, 0x00, 0x12, 0xff, 0x00, 0x2c, 0x3f };
        public byte[] SetD03Off = { 0x01, 0x05, 0x00, 0x12, 0x00, 0x00, 0x6d, 0xcf };
        public byte[] SetD04On = { 0x01, 0x05, 0x00, 0x13, 0xff, 0x00, 0x7d, 0xff };
        public byte[] SetD04Off = { 0x01, 0x05, 0x00, 0x13, 0x00, 0x00, 0x3c, 0x0f };
        public byte[] SetD05On = { 0x01, 0x05, 0x00, 0x14, 0xff, 0x00, 0xcc, 0x3e };
        public byte[] SetD05Off = { 0x01, 0x05, 0x00, 0x14, 0x00, 0x00, 0x8d, 0xce };
        public byte[] SetD06On = { 0x01, 0x05, 0x00, 0x15, 0xff, 0x00, 0x9d, 0xfe };
        public byte[] SetD06Off = { 0x01, 0x05, 0x00, 0x15, 0x00, 0x00, 0xdc, 0x0e };
        public byte[] SetD07On = { 0x01, 0x05, 0x00, 0x16, 0xff, 0x00, 0x6d, 0xfe };
        public byte[] SetD07Off = { 0x01, 0x05, 0x00, 0x16, 0x00, 0x00, 0x2c, 0x0e };
        public byte[] SetD08On = { 0x01, 0x05, 0x00, 0x17, 0xff, 0x00, 0x3c, 0x3e };
        public byte[] SetD08Off = { 0x01, 0x05, 0x00, 0x17, 0x00, 0x00, 0x7d, 0xce };
    }
}
